package com.woniu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.entity.RoleMidAuth;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hyl
 * @since 2022-08-28
 */
public interface RoleMidAuthMapper extends BaseMapper<RoleMidAuth> {
    /**
     * 增加权限明细
     *
     * @param roleId 角色 id
     * @param authId 权限 id
     */
    @Insert("insert into role_mid_auth (role_id , auth_id) values (#{roleId} , #{authId})")
    void insert(@Param("roleId") int roleId, @Param("authId")int authId);

    @Delete("delete from role_mid_auth where role_id = #{roleId}")
    void deleteAccessesByRoleId(int roleId);
}
